From: Glenn Morris Date: Fri, 4 Mar 2011 08:21:56 +0000 (-0800) Subject: browse-url fix for bug#6077. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4532 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6b26c29e2e3463d86d92d1e766e04698110bafbf;p=emacs.git browse-url fix for bug#6077. * lisp/net/browse-url.el (browse-url): Handle deleted default-directory. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 21909a3a83f..2588b4a49fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-03-04 Glenn Morris + * net/browse-url.el (browse-url): + Handle deleted default-directory. (Bug#6077) + * recentf.el (recentf-include-p): In case of a buggy predicate, err on the side of including, not excluding. (Bug#5843) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 660eb3b968e..24dbfc0c30a 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -798,7 +798,12 @@ first, if that exists." (let ((process-environment (copy-sequence process-environment)) (function (or (and (string-match "\\`mailto:" url) browse-url-mailto-function) - browse-url-browser-function))) + browse-url-browser-function)) + ;; Ensure that `default-directory' exists and is readable (b#6077). + (default-directory (if (and (file-directory-p default-directory) + (file-readable-p default-directory)) + default-directory + (expand-file-name "~/")))) ;; When connected to various displays, be careful to use the display of ;; the currently selected frame, rather than the original start display, ;; which may not even exist any more.